<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<title>通过密保问题找回</title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			.info{width: 100%;height: 2.34rem;background: #fff;position: absolute;/*top: 0.9rem;*/left: 0;text-align: center;line-height:2.34rem;font-size: 0.28rem;}
			.question{width: 100%;height: 0.8rem;background: #fff;position: absolute;top: 2.35rem;left: 0;font-size: 0.26rem;padding:0.21rem 0.35rem 0.26rem 0.37rem;box-sizing: border-box;color: #a7a7a7;}
			.question span:last-child{float: right; color: #333333;}
			.question span b{color: #a7a7a7;}
			.answer{width: 100%;height: 0.9rem;background: #fff;position: absolute;top:3.17rem;left: 0;font-size: 0.26rem;color: #a7a7a7;padding:0.21rem 0.35rem 0.26rem 0.37rem;box-sizing: border-box;}
			.answer .mui-input-row{line-height: 21px;width: 70%;height: 0.9rem;margin-bottom: 0 !important;padding:0 !important;-webkit-user-select: text;border: none !important;position: absolute;top: 0;right: 0;outline: 0 !important;background-color: #fff;-webkit-appearance: none;}
			.answer .mui-input-row input{width: 100%;height: 100%;border: none !important;text-align: right;padding-right: 0.7rem;color: #333;font-size: 0.26rem;}
			.question2{top: 4.15rem;}
			.answer2{top: 4.97rem;}
			/*.question3{top: 6.95rem;}
			.answer3{top:7.78rem ;}*/
			.answer .mui-input-row .mui-icon-clear{font-size: 0.37rem;top: 0.27rem;right: 0.3rem;width: 0.38rem;height: 0.38rem;text-align: center; color: #cccccc;}
			.save{width: 6rem;height: 0.68rem;background: #117afd;font-size: 0.3rem;color: #fff;border: none;outline: none;position: absolute !important;top: 7.01rem  !important;left: 0.75rem !important;border-radius: 0.1rem;}
			.select-box{width: 100%;/*height: 3.71rem;*/background: #fff;position: absolute;bottom: 0;}
			.select-box ul{margin: 0 !important;padding: 0 !important;}
			.select-box ul li{border-bottom: 1px solid #e7e7e7;height: 0.86rem;text-align: center;color: #265efc;line-height: 0.86rem;}
			.select-box ul li:last-child{border-bottom: none; color: #333333;}
			.select-box ul li:first-child,.select-box ul li:last-child{height: 0.95rem;line-height: 0.95rem !important;}
		</style>
	</head>
	<body>
		<!--<div class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<a class="back">返回</a>
			<h1 class="mui-title">密保问题</h1>
		</div>-->
		<div class="info">请输入密保问题答案</div>
		<div class="question question1"><span>密保问题一</span><span id="qs1"><b>></b></span></div>
		<div class="answer answer1">
			<span>答案</span>	
			<div class="mui-input-row">
				<input type="text" class="mui-input-clear" id="as1">
			</div>
		</div>
		<div class="question question2"><span>密保问题二</span><span id="qs2"><b>></b></span></div>
		<div class="answer answer2">
			<span>答案</span>	
			<div class="mui-input-row">
				<input type="text" class="mui-input-clear" id="as2">
			</div>
		</div>
		<button class="save">下一步</button>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script src="../../js/app.js" ></script>
	<script>
		var quesA= '';
		var quesB = '';
		var loginUserName = '';
		mui.plusReady(function(){
			quesA = localStorage.getItem('quesA');
			quesB = localStorage.getItem('quesB');
			loginUserName = utils.getUrlParam('loginUserName');
			document.getElementById('qs1').innerText = quesA;
			document.getElementById('qs2').innerText = quesB;
			
		});
		//保存
		document.querySelector('.save').addEventListener('tap',function(){
			var a1 = document.getElementById('as1').value;
			var a2 = document.getElementById('as2').value;
			//数据验证
			if (a1 == '') {
				mui.toast('请输入问题一答案');
				return;
			}
			if (a2 == '') {
				mui.toast('请输入问题二答案');
				return;
			}
			var param = {};
			param.loginUserName = loginUserName;
			param.answer1 = a1;
			param.answer2 = a2;
			utils.ajax('appHttpService/appConfirmQues.do',function(data){
				var data = JSON.parse(data);
				if (data.state == '1') {
					location.href = 'recoverPassword3.html?loginUserName='+loginUserName;
				} else {
					mui.toast(data.msg);
				}
			},jsonToParams(param),null,function(){
				mui.toast('抱歉，当前服务不可用，请稍后再试');
			})
		});
		
	</script>
</html>